import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)
export default new Vuex.Store({
    // ...
    state:{
        nickName:"",
        goodsCartCount:0
    },
    mutations:{
        setNickName(state,payload) {
            state.nickName = payload.nickName
        },
        setCount(state,payload) {
            if(payload.init){
                state.goodsCartCount = payload.count
            }else{
                state.goodsCartCount += payload.count
            }
            
        },
        
    },
    getters:{

    },
    actions:{

    }
})